<head>
	<title>产品列表</title>
</head>
<script type="text/javascript" src="<?php echo __PUBLIC__?>Admin/js/jquery.autotextarea.js"></script>

<div id="dcMain">
	<!-- 当前位置 -->
	<div id="urHere">DouPHP 管理中心<b>></b><strong>产品列表</strong> </div>
	<div class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
		<h3><a href="index.php?m=admin&c=product&a=add" class="actionBtn add">添加产品</a>产品列表</h3>
		<div class="filter">
			<form action="index.php?m=admin&c=product&a=select" method="post">
				<select name="cat_id">
					<option value="0">所有产品</option>
					<?php foreach($this->cat as $val):?>
					<?php if($this->cat_id == $val['id']){?>
					<option value="<?php echo $val['id'];?>" selected="selected">
						<?php echo $val['name'];?>
					</option>
					<?php }else{?>
					<option value="<?php echo $val['id'];?>">
						<?php echo $val['name'];?>
					</option>
					<?php }?>
					<?php endForeach;?>
				</select>
				<input name="keyword" type="text" class="inpMain" value="<?php echo $this->userKeyWord?>" size="20" />
				<input name="submit" class="btnGray" type="submit" value="筛选" />
			</form>
		</div>
		<div id="list">
			<form name="action" method="post" action="index.php?m=admin&c=product&a=change">
				<table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
					<tr>
						<th width="22" align="center"><input name='chkall' type='checkbox' id='chkall' onclick='selectcheckbox(this.form)' value='check'></th>
						<th width="40" align="center">编号</th>
						<th align="left">产品名称</th>
						<th width="700" align="center">产品图片</th>
						<th width="80" align="center">产品分类</th>
						<th width="80" align="center">操作</th>
					</tr>
					<?php foreach($this->data['data'] as $val):?>
					<tr>
						<td align="center"><input type="checkbox" name="checkbox[]" value="<?php echo $val['id'];?>" /></td>
						<td align="center">
							<?php echo $val['id'];?>
						</td>
						<td>
							<a href="index.php?m=admin&c=product&a=edit&id=<?php echo $val['id'];?>">
								<?php echo $val['pro_name'];?>
							</a>
						</td>
						<td>
							<?php echo $val['pro_src'];?>
						</td>
						<td align="center">
							<a href="article.php?cat_id=1">
								<?php echo $val['cat_name'];?>
							</a>
						</td>

						<td align="center">
							<a href="index.php?m=admin&c=product&a=edit&id=<?php echo $val['id'];?>">编辑</a> |
							<a href="index.php?m=admin&c=product&a=delete&id=<?php echo $val['id'];?>">删除</a>
						</td>
					</tr>
					<?php endForeach;?>

				</table>
			</form>
		</div>
		<div class="clear"></div>

		<?php echo $this->data['html'];?>
		<?php echo $this->data['css'];?>
		<?php echo $this->data['js'];?>

	</div>

	<script type="text/javascript">
		onload = function() {
			document.forms['action'].reset();
		}

		function douAction() {
			var frm = document.forms['action'];

			frm.elements['new_cat_id'].style.display = frm.elements['action'].value == 'category_move' ? '' : 'none';
		}
	</script>